﻿using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.ExceptionHandling;

namespace XDQ.VAT.Web.Filters
{
    public class MyExceptionSubscript : ExceptionSubscriber
    {
        public ILogger<MyExceptionSubscript> Logger { get; set; }

        public override Task HandleAsync(ExceptionNotificationContext context)
        {
            if (context.Handled)
            {
                Logger.LogWarning("都已经处理了！");
            }
            else
            {
                Logger.LogError(context.Exception, "由Subscriber处理");
            }
            return Task.Delay(0);
        }
    }
}
